newInstance

open fun newInstance(renderingMode: RenderingMode): Engine

Initializes and runs the Chromium engine in the given renderingMode.

Depending on the hardware performance, the initialization process might take several seconds. So, do not call this method in the application UI thread.

The method performs the following actions:

  1. Checks the environment and makes sure that it is supported.
  2. Locates the Chromium binaries and extracts them if it is necessary.
  3. Runs the main native process and initializes the Chromium engine.
  4. Setup IPC connection between Java and the main native process.

Return

a new instance of the Engine

Parameters

renderingMode

the rendering mode indicating how the content of the web pages will be rendered

Throws

when the current environment is not supported

when the given user data directory does not exist and cannot be created

when the given user data directory is already in use.

when Inter-Process Communication (IPC) setup has been failed

when startup of the Chromium process has been failed

when no license found

when no valid license found

when the verification of the Chromium binary files has failed and the binaries cannot be extracted from the resources

when Chromium fails to find the required system libraries. This exception can only be thrown on Linux


open fun newInstance(options: EngineOptions): Engine

Initializes and runs the Chromium engine with the given options.

Depending on the hardware performance, the initialization process might take several seconds. So, do not call this method in the application UI thread.

The method performs the following actions:

  1. Checks the environment and makes sure that it is supported.
  2. Locates the Chromium binaries and extracts them if it is necessary.
  3. Runs the main native process and initializes the Chromium engine.
  4. Setup IPC connection between Java and the main native process.

Return

a new instance of the Engine

Parameters

options

the engine options

Throws

when the current environment is not supported

when the given user data directory does not exist and cannot be created

when the given user data directory is already in use.

when Inter-Process Communication (IPC) setup has been failed

when startup of the Chromium process has been failed

when no license found

when no valid license found

when the verification of the Chromium binary files has failed and the binaries cannot be extracted from the resources

when Chromium fails to find the required system libraries. This exception can only be thrown on Linux